import { AnyAction } from "redux";
import { produce } from 'immer';
export interface InitState {
  token: string;
}

const initState: InitState = {
    token: "",
};
const reducer = (state: InitState = initState, action: AnyAction) =>
    produce(state, drafState=>{
        switch (action.type) {
            case "SET_TOKEN":
                drafState.token = action.token;
                break;
            default:
                return drafState;
        }
    });

export default reducer;
